<template>
  <div>
    <el-dialog
      :close-on-click-modal="false"
      :visible.sync="dialogVisible"
      title="还原客户"
      width="420px">
      <el-form :model="sendForm" size="mini" label-width="100px">
        <el-form-item label="选择日期：" prop="delayDay">
          <el-radio-group v-model="sendForm.delayDay" style="display:flex;flex-direction:column;margin-top:8px;">
            <el-radio :label="30" style="height: 30px;">30天</el-radio>
            <el-radio :label="60" style="height: 30px;">60天</el-radio>
            <el-radio :label="90" style="height: 30px;">90天</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
      <el-button @click="handleClose">取 消</el-button>
      <el-button type="primary" @click="handleConfirm" :loading="btnLoading">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import {
  delayCustomerAPI
} from '@/api/fms.js';
export default {
  name: "delayCms",
  data(){
    return {
      dialogVisible:false,
      list2:[],
      isCharge:'',
      btnLoading: false,
      sendForm: {
        delayDay: 30,
        customerId:'',
      },
    }
  },
  filters:{

  },
  created() {

  },
  methods:{
    showPop(item) {
      this.sendForm.customerId = item.customerId;
      this.dialogVisible=true;
    },
    handleClose() {
      this.dialogVisible = false;
      this.btnLoading = false;
    },
     //确认转移
    handleConfirm() {
      this.btnLoading = true;
      const data=JSON.parse(JSON.stringify(this.sendForm))
      delayCustomerAPI(data).then((res) => {
        this.$message.success('还原成功')
        this.handleClose();
        this.$emit('update');
      }).catch(() => {
        this.btnLoading = false;
      })
    },
  }
};
</script>

<style scoped lang="scss">

</style>
